<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%

String menuid = request.getParameter("menuid")==null?"223":request.getParameter("menuid");

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>山西煤炭现货公路交易系统客户端</title>
<link href="<s:url value="/resources"/>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-1.7.2.min.js"></script>
</head>
<script type="text/javascript">

$(function(){  
var pid=<%=menuid%>;
 //alert(pid);
   var url = "user/findMenu";
      $.post(url,{menuType:2,pid:pid},function(data){ 
        var obj = eval('(' + data + ')');
        var menu ="<ul class=\"nav\">";
        for(var i=0;i<obj.length;i++){
        var menutitle=obj[i].menutitle;
        if(menutitle.length>=5){ menutitle="&nbsp;&nbsp;&nbsp;&nbsp;"+menutitle;}                  
          menu+="<li><a href=\"javascript:daoh(\'"+obj[i].customurl+"\',\'"+menutitle+"\');\" class=\"ideal"+i+"\"  >"+menutitle+"</a></li>";       
       
        }
        menu+="</ul>";
        // alert(menu);        
         $("#leftmenu").html(menu);
        // if(login=="0")
         loadDefultUrl(obj);
         loadDefultJsp();        
        }); 
       
           
 });
 
 function daoh(url,menutitle){
    window.parent.document.getElementById("mainFrame").src=url; 
    var　topFrame = window.parent.document.getElementById("topFrame"); 
　       var aa=　topFrame.contentWindow.document.getElementById("menutitle");
    aa.innerText ="当前位置："+menutitle;
 }
 
 function loadDefultUrl(obj){
     var url = obj[0].customurl;
     var menutitle=obj[0].menutitle;
     window.parent.document.getElementById("mainFrame").src="<c:url value='/'/>"+url;
     var　topFrame = window.parent.document.getElementById("topFrame");  
　          var aa=　topFrame.contentWindow.document.getElementById("menutitle");
     aa.innerText ="当前位置："+menutitle;
     $.post(url);        
 }
 
 function loadDefultJsp(){
     //alert(flag);
     var　topFrame = window.parent.document.getElementById("topFrame");
     var flag = topFrame.contentWindow.document.getElementById("flag").value; 
     if(flag=="0"){
     window.parent.document.getElementById("mainFrame").src="tongz.jsp";
     topFrame.contentWindow.document.getElementById("flag").value = "1"; 
     }
    
 }
 
 
</script>
<body>
<div id="left">
<div id="leftmenu"></div>
<br class="spacer" />
</div>
</body>
</html>
